<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActiveSupport::LogSubscriber::TestHelper::MockLogger</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActiveSupport::LogSubscriber::TestHelper::MockLogger 
            
                <span class="parent">&lt; 
                    
                    <a href="../../../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../../files/activesupport/lib/active_support/log_subscriber/test_helper_rb.html">activesupport/lib/active_support/log_subscriber/test_helper.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>F</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="MockLogger.html#method-i-flush">flush</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>L</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="MockLogger.html#method-i-logged">logged</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>M</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="MockLogger.html#method-i-method_missing">method_missing</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="MockLogger.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  
    <!-- Includes -->
    <div class="sectiontitle">Included Modules</div>
    <ul>
      
        <li>
          
            ActiveSupport::Logger::Severity
          
        </li>
      
    </ul>
  



  

    

    

    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>flush_count</td>
            <td class='attr-desc'></td>
          </tr>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [RW]
            </td>
            <td class='attr-name'>level</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(level = DEBUG)
            
            <a href="MockLogger.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/f89fa2ae71f8a0496b84793b2a2ad205127f3102/activesupport/lib/active_support/log_subscriber/test_helper.rb#L58" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 58</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">level</span> = <span class="ruby-constant">DEBUG</span>)
  <span class="ruby-ivar">@flush_count</span> = <span class="ruby-number">0</span>
  <span class="ruby-ivar">@level</span> = <span class="ruby-identifier">level</span>
  <span class="ruby-ivar">@logged</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = [] }
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-flush">
            
              <b>flush</b>()
            
            <a href="MockLogger.html#method-i-flush" name="method-i-flush" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-flush_source')" id="l_method-i-flush_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/f89fa2ae71f8a0496b84793b2a2ad205127f3102/activesupport/lib/active_support/log_subscriber/test_helper.rb#L76" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-flush_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 76</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">flush</span>
  <span class="ruby-ivar">@flush_count</span> <span class="ruby-operator">+=</span> <span class="ruby-number">1</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-logged">
            
              <b>logged</b>(level)
            
            <a href="MockLogger.html#method-i-logged" name="method-i-logged" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-logged_source')" id="l_method-i-logged_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/f89fa2ae71f8a0496b84793b2a2ad205127f3102/activesupport/lib/active_support/log_subscriber/test_helper.rb#L72" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-logged_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 72</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">logged</span>(<span class="ruby-identifier">level</span>)
  <span class="ruby-ivar">@logged</span>[<span class="ruby-identifier">level</span>].<span class="ruby-identifier">compact</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span> }
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-method_missing">
            
              <b>method_missing</b>(level, message = nil)
            
            <a href="MockLogger.html#method-i-method_missing" name="method-i-method_missing" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-method_missing_source')" id="l_method-i-method_missing_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/f89fa2ae71f8a0496b84793b2a2ad205127f3102/activesupport/lib/active_support/log_subscriber/test_helper.rb#L64" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-method_missing_source" class="dyn-source">
                <pre><span class="ruby-comment"># File activesupport/lib/active_support/log_subscriber/test_helper.rb, line 64</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">method_missing</span>(<span class="ruby-identifier">level</span>, <span class="ruby-identifier">message</span> = <span class="ruby-keyword">nil</span>)
   <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>
     <span class="ruby-ivar">@logged</span>[<span class="ruby-identifier">level</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">yield</span>
   <span class="ruby-keyword">else</span>
     <span class="ruby-ivar">@logged</span>[<span class="ruby-identifier">level</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">message</span>
   <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    